package nl.utwente.csc.obsl.diagram.extension.figure;


import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.sirius.diagram.ui.tools.api.figure.StyledFigure;

public class SubKindFigure extends Shape implements StyledFigure {

	
	 protected void outlineShape(final Graphics graphics) {
		 graphics.drawPolygon(getPointList());
	 }
	 
	 protected void fillShape(final Graphics graphics) {
		 graphics.fillPolygon(getPointList());
	 }
		 
	public SubKindFigure() {
	}	
	protected PointList getPointList() {
		final Rectangle r = new Rectangle();
		final PointList pointList = new PointList();
		r.x = bounds.x + getLineWidth() / 2;
		r.y = bounds.y + getLineWidth() / 2;
		r.width = bounds.width - getLineWidth();
		r.height = bounds.height - getLineWidth();
		int space = 15;
		pointList.removeAllPoints();

		pointList.addPoint(r.x, r.y);
		pointList.addPoint(r.x + r.width - space, r.y);
		pointList.addPoint(r.x + r.width, r.y+ space);
		pointList.addPoint(r.x + r.width, r.y + r.height);
		pointList.addPoint(r.x, r.y + r.height);

		return pointList;
	}
	
	

}